
function mytop_nav(pathname){
    // 数据
    let arr = [
        {
            title:"跑步",
            path: "./run.html"
        },
        {
            title:"骑行",
            path: "./ride.html"
        },
        {
            title:"课程训练",
            path: "./course.html"
        },
    ]
    // 模板
    let html =`
    ${arr.map(function(v,i){
        return ` <a href="${v.path}" class="${v.path===`./${pathname}.html`?"active":""}">${v.title}</a>`
    }).join("")}
    `
    let div = document.createElement("div");
    div.className ="mytop df jcse aic";
    div.innerHTML = html;
    document.body.prepend(div);
}

module.exports = mytop_nav